﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;

namespace WebApplication2.student
{
    public partial class 个人信息 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["xh"] == null)
            {
                Response.Write("<SCRIPT LANGUAGE=\"JavaScript\">alert('你还没有登录'):window.location.href='../login.aspx':</SCRIPT>");

            }
            else
            {
                Database db = new Database();
                string xh = Session["xh"].ToString();
                string sql = "select * from xs where xh ='" + xh + "'";
                DataTable dt = db.SelectSQL(sql);
                DataRow dr = dt.Rows[0];
                Label1.Text = dr["xm"].ToString();
                Label2.Text = dr["xb"].ToString();
                Label3.Text = dr["mz"].ToString();
                Label4.Text = dr["csrq"].ToString();
                Label5.Text = dr["xy"].ToString();
                Label6.Text = dr["zy"].ToString();
                Label7.Text = dr["bj"].ToString();
                Label8.Text = dr["sj"].ToString();
                Label9.Text = dr["yx"].ToString();
                Label10.Text = dr["txdz"].ToString();
                string ph = "~\\image\\" + dr["photo"].ToString();
                if (ph != "~\\image\\")
                {
                    Image2.ImageUrl = ph;
                }
                else
                {
                    Image2.ImageUrl = "../image/男生1.jpg";
                }
            }
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            Response.Redirect("个人信息修改.aspx");
        }
    }
}